<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title></title>
		<meta http-equiv="pragma" content="no-cache">
        <meta http-equiv="cache-control" content="no-cache">
        <meta http-equiv="expires" content="0">
		<link rel="stylesheet" type="text/css" href="<c:url value="/static/jquery-easyui/themes/default/easyui.css"/>">
		<link rel="stylesheet" type="text/css"
			href="<c:url value="/static/jquery-easyui/themes/icon.css"/>">
		<script type="text/javascript"
			src="<c:url value="/static/jquery-easyui/jquery-1.6.min.js"/>"></script>
		<script type="text/javascript"
			src="<c:url value="/static/jquery-easyui/jquery.easyui.min.js"/>"></script>
		<script type="text/javascript"
			src="<c:url value="/static/jquery-easyui/plugins/jquery.panel.js"/>"></script>
		<script type="text/javascript"
			src="<c:url value="/static/jquery-easyui/plugins/jquery.datagrid.js"/>"></script>
		<script type="text/javascript"
			src="<c:url value="/static/jquery-easyui/plugins/jquery.messager.js"/>"></script>
		<script type="text/javascript"
			src="<c:url value="/static/jquery-easyui/ext-for-framework.js.jsp"/>"></script>
		<script type="text/javascript" src="<c:url value="/static/jquery-easyui/locale/easyui-lang-zh_CN.js"/>"></script>		
		<script type="text/javascript"
			src="<c:url value="/static/js/common.js"/>"></script>		
		<script>
		
			function initList(listDisplayEId) {
				$('#' + listDisplayEId).datagrid(
						{
							nowrap : false,
							striped : true,
							collapsible : true,
							remoteSort : true,
							notSelectByRow : false,
							/* frozenColumns : [ [ {
								field : 'ids',
								checkbox : true
							} ] ], */
							toolbar : [
									
									],
							onLoadError:function(){
								$.messager.alert('错误','获取数据失败，请与管理员联系！','error');
							}
						 ,onClickRow:function(rowIndex){
								$(".myrad").prop("checked",false);
								$(".myrad").eq(rowIndex).prop("checked",true);
								var row = $('#'+listDisplayEId).datagrid('getRows');
								if (row[0]['storeInWay'] == "2"){
									$('#listDisplay').datagrid('beginEdit', rowIndex);
								} 
							} 
						});
			};
			$(document).ready(function() {
				initList('listDisplay');
			});
			
			function deal(){
 	 			$('#AddFoodForm').form('submit',
 				{
 					url:'<c:url value='/account/commitAccount.do'/>', //查询提交路径
 					onSubmit:function()//提交按钮相应函数
 					{
 						return $('#AddFoodForm').form('validate');
 					},
 					success:function(data){
 						data = eval( "("+data+")" );
 		       			if(data.success){
 		       				$.messager.alert("提示", "提交成功！",'info', function(){
 		       					window.close();
							});
 	       				}else{
 		       				$.messager.alert("提示", data.msg, 'warning');
 	       				}
 					},
 					error:function(){
 						$.messager.alert("错误", "系统错误，请联系管理员！", 'error');
 						return;
 					}
 				});
 	 			
 			}
		 
			function formatRadio(value,rowData,rowIndex){
				return value="<input type='radio' class='myrad'  name='radioStore' />";
			}
			 
	
			function searchInfo(){
				if($('#commentState').combobox('getValue') ==''){
					$('#listDisplay').datagrid('load', {
						commentState : 0,
						commentDateStart : $('#commentDateStart').datebox('getValue'),
						commentDateEnd : $('#commentDateEnd').datebox('getValue'),
						unitName : $('#unitName').val()
					}); 
				}else{
					$('#listDisplay').datagrid('load', {
						commentState : $('#commentState').combobox('getValue'),
						commentDateStart : $('#commentDateStart').datebox('getValue'),
						commentDateEnd : $('#commentDateEnd').datebox('getValue'),
						unitName : $('#unitName').val()
					});  
				}
			}
			$(function() {        
		        // 下拉框选择控件，下拉框的内容是动态查询数据库信息  
		        $('#commentState').combobox({   
		            data:[{"commentState":"0","commentStateName":"全部"},{"commentState":"1","commentStateName":"好评"},{"commentState":"2","commentStateName":"中评"},{"commentState":"3","commentStateName":"差评"}],   
		            editable:false, //不可编辑状态  
		            cache: false,  
		            valueField:'commentState',     
		            textField:'commentStateName',  
		        });      
		        
		    }); 
			
		</script>
			</head>
			<body>
			<table width="98%">
			<tr><td>
			
			<table width="98%">
			<tr><td>
			<div style="height: auto; width:1180px;background: #fafafa; padding: 5px;" class="easyui-panel" title="查询" iconCls="icon-search" collapsible="true" minimizable="false" maximizable="false" closable="false">
					<form id="searchForm" name="searchForm" method="post"
						action="userlist.txt"
						onsubmit="return searchDGData(this.id,'listDisplay');">
						<div>
		            	<table cellpadding="5">
								<tr>
								
									<td>评论起始日：</td>
									<td><input class="easyui-datebox" editable="true" id="commentDateStart" name="commentDateStart"></input></td>
									<td>评论截止日：</td>
									<td><input class="easyui-datebox" editable="true" id="commentDateEnd" name="commentDateEnd"></input></td>
									<td>评论状态：</td>
									<td><input class="easyui-combobox" id="commentState" editable="commentState" name="supId"></input></td>
							        <td>机构名称：</td>
									<td><input class="easyui-validatebox" id="unitName" name="unitName"></input></td>
		                    		<td><input type="button" onclick="searchInfo()" value="查询"></td>
		                    	</tr>
		                </table>					 
						</div>
					</form>
				</div>
			</td></tr>
			<table width="98%">
			</tr></td>
			<tr><td>
			
			<table id="listDisplay" title="结算总单列表" 
				iconCls="icon-list" singleSelect="false" idField="id"
				url="<c:url value="/unit/listUnitComment.do"/>" loadMsg="请稍候......"
				pagination="true" pageSize="100"
				pageList="[10,20,30,40,50,100]" sortName="storeInId"
				rownumbers="true" sortOrder="asc" showFooter="true">
			<thead>
				<tr>
					<th field="cid" width="40"  sortable="true" editor="text" hidden="true">
						评论id
					</th>
					<th field="unitId" width="140"  sortable="true"  >
						机构id
					</th>
					<th field="unitName" width="140"  sortable="true"  >
						机构名称
					</th>
					<th field="commentState" width="60"  sortable="true"  formatter="formatCommentState">
						评论状态
					</th>	
					<th field="commentText" width="300"  sortable="true" >
						评论内容
					</th>	
					<th field="commentDate" width="80"  sortable="true" >
						评论时间
					</th>
 				</tr>
			</thead>
			</table>
			</td>
			</tr>
		</table>
	</body>
</html>